package top.wxdfun.sqlwr.controller;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import top.wxdfun.sqlwr.entity.User;
import top.wxdfun.sqlwr.service.IUserService;

import java.util.List;

@RestController
@AllArgsConstructor
public class UserController {
    private IUserService userService;

    @GetMapping("/list")
    public List<User> listUser() {
        return userService.listUser();
    }

    @GetMapping("/del/{id}")
    public Boolean removeUser(@PathVariable("id") Integer id) {
        return userService.delUser(id);
    }
}
